using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWeaponResDao:DaoBase<TableWeaponRes>
    {
        public override void AddPrimaryIndex(TableWeaponRes model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWeaponRes.txt";
        }

        protected override TableWeaponRes ParseRowData(string[] rowData)
        {
            TableWeaponRes data = new TableWeaponRes();
			data.id = rowData [0];
			data.heroId = rowData [1];
			data.equipId = rowData [2];
			data.iconRes = rowData [3];
			data.pngRes = rowData [4];
			data.nameRes = rowData [5];
			data.modelRes0 = rowData [6];
			data.modelRes1 = rowData [7];

            return data;
        }



        public override void AddTwoIndex(TableWeaponRes model)
        {
            string key = GetUnionKey(model.heroId.ToString(),model.equipId.ToString());
            if (!cacheTwoIndex.ContainsKey(key))
            {
                cacheTwoIndex[key] = new List<TableWeaponRes>();
            }
            cacheTwoIndex[key].Add(model);
        }


    }

}
